#include "Device.h"

Device::Device(int winWidth, int winHeight, core::stringw windowName)
{
	deviceMgr = createDevice(video::EDT_OPENGL, core::dimension2d<u32>(winWidth, winHeight), 16, false, false, false, &receiver);
	assert(deviceMgr != NULL);
	smgr = deviceMgr->getSceneManager();
	driver = deviceMgr->getVideoDriver();
	guis = deviceMgr->getGUIEnvironment();
	dataArchive = deviceMgr->getFileSystem();
	deviceMgr->setWindowCaption(windowName.c_str());
	fontBuilt = deviceMgr->getGUIEnvironment()->getBuiltInFont();

	//Load Data
	dataArchive->addZipFileArchive(DATA_FILE);
	assert(dataArchive != NULL);
}

Device::~Device()
{
	if(deviceMgr)
		SAFE_DEL(deviceMgr);
}

